package study04;

import java.util.Arrays;
import java.util.List;

public class Java13_utils {
    public static void main(String[] args) throws Exception {
//        集合 - Arrays
        int[] is = {2, 5, 4, 3, 1};
        int[] is1 = {1, 2, 3, 4, 5};
        int[] is2 = {1, 2, 3, 4, 5, 6};
        System.out.println(Arrays.toString(is));
        System.out.println(is);

        List<Integer> list = Arrays.asList(1, 2, 3, 4, 5);
        System.out.println(list);

//        排序
        Arrays.sort(is);
        System.out.println(Arrays.toString(is));
//        二分查找法
        System.out.println(Arrays.binarySearch(is, 5));
//        数组的比较
        System.out.println(Arrays.equals(is, is1));
//        只比教前五个
        System.out.println(Arrays.equals(is1, 0, 5, is2, 0, 5));
    }
}
